package com.mt.mtbusinessmanagementsystem.utils.product.level;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Builder
@Repository
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class FourthLevel implements ProductClassLevel{
    private Integer fourthClassificationId;
    private String fourthClassificationName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;
    public static FourthLevel fromProductClassLevel(ProductClassLevel productClassLevel) {
        if (productClassLevel instanceof FourthLevel) {
            return (FourthLevel) productClassLevel;
        } else {
            throw new IllegalArgumentException("不能转换为FourthLevel类");
        }
    }


}
